package com.tonyodev.fetch2.downloader;

import com.tonyodev.fetch2.Download;

import java.io.Closeable;
import java.util.List;

/**
 * @since 2021-05-20
 */
public interface DownloadManager extends Closeable {

    boolean getIsClosed();
    int getConcurrentLimit();
    void setConcurrentLimit(int concurrentLimit);

    boolean start(Download download);
    boolean cancel(int downloadId);
    void cancelAll();
    boolean contains(int downloadId);
    boolean canAccommodateNewDownload();
    int getActiveDownloadCount();
    List<Download> getActiveDownloads();
    List<Integer> getActiveDownloadsIds();
    FileDownloader getNewFileDownloaderForDownload(Download download);
    FileDownloader.Delegate getFileDownloaderDelegate();
    String getDownloadFileTempDir(Download download);

}
